<%-- 
    Document   : Statistics_Staff
    Created on : Oct 22, 2013, 12:02:00 AM
    Author     : ZERO
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
        </head>
        <body>
            <h:panelGrid columns="4">
                <h:form>
                    <h1><h:outputText value="Statistics"/></h1>                                      
                    <h:commandButton action="#{staff.classByStaffID()}" value="Class"></h:commandButton>
                    <br/><h:outputLabel value="Class name:" for="class name"></h:outputLabel> 
                    <c:forEach var="cl" items="#{staff.classes}" >
                        <br/> <h:commandLink action="#{staff.studentByClass(cl.classid)}" value="#{cl.classname}"></h:commandLink>
                    </c:forEach>
                </h:form>
                &nbsp;&nbsp;&nbsp;&nbsp;<h:form>              
                    <h:outputLabel value="Student name:" for="student name"></h:outputLabel> 
                    <h:inputText value="#{staff.studentname}" ></h:inputText>
                    <h:commandButton action="#{staff.studentByName()}" value="View Student"></h:commandButton>
                    <h:dataTable border="1" var="student" value="#{staff.ses}" >
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="Student ID"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.studentid}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="EmailName"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.emailname}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="Name"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.firstname}"></h:outputText>&nbsp;
                            <h:outputText value="#{student.lastname}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="Address"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.address}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="Phone"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.phone}"></h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="BirthDay"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.birthday}">
                                <f:convertDateTime pattern="dd-MM-yyyy"></f:convertDateTime>
                            </h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputLabel value="Gender"></h:outputLabel>
                            </f:facet>
                            <h:outputText value="#{student.gender}"></h:outputText>
                        </h:column>
                    </h:dataTable>
                    <h:commandLink action="#{staff.conection()}" value="Mark"></h:commandLink>
                </h:form>
            </h:panelGrid>
        </body>
    </html>
</f:view>
